From 19a7b277b5c0ff6d5226a96a669bc7a150367343 Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Wed, 4 Dec 2013 01:47:54 +0200 Subject: [PATCH] Add PLURAL support to youhavenewmessages* Add PLURAL support on the number of talkpage messages received in system messages youhavenewmessagesfromusers and youhavenewmessages. Bug: 53897 Change-Id: Ic08c51f651fe4101ed0b6fcdaea4b4ae74331f70 --- includes/Skin.php | 4 ++-- languages/messages/MessagesEn.php | 4 ++-- languages/messages/MessagesQqq.php | 18 +++++++++++++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 750f319ad7..26fea954e2 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1419,14 +1419,14 @@ abstract class Skin extends ContextSource { 'youhavenewmessagesfromusers', $newMessagesLink, $newMessagesDiffLink - )->numParams( $nofAuthors ); + )->numParams( $nofAuthors, $plural ); } else { // $nofAuthors === 11 signifies "11 or more" ("more than 10") $newMessagesAlert = $this->msg( $nofAuthors > 10 ? 'youhavenewmessagesmanyusers' : 'youhavenewmessages', $newMessagesLink, $newMessagesDiffLink - ); + )->numParams( $plural ); } $newMessagesAlert = $newMessagesAlert->text(); # Disable Squid cache diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e6ecc782dc..648aa18563 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -939,8 +939,8 @@ See [[Special:Version|version page]].', 'pagetitle-view-mainpage' => '{{SITENAME}}', # only translate this message to other languages if you have to change it 'backlinksubtitle' => '← $1', # only translate this message to other languages if you have to change it 'retrievedfrom' => 'Retrieved from "$1"', -'youhavenewmessages' => 'You have $1 ($2).', -'youhavenewmessagesfromusers' => 'You have $1 from {{PLURAL:$3|another user|$3 users}} ($2).', +'youhavenewmessages' => '{{PLURAL:$3|You have}} $1 ($2).', +'youhavenewmessagesfromusers' => '{{PLURAL:$4|You have}} $1 from {{PLURAL:$3|another user|$3 users}} ($2).', 'youhavenewmessagesmanyusers' => 'You have $1 from many users ($2).', 'newmessageslinkplural' => '{{PLURAL:$1|a new message|999=new messages}}', 'newmessagesdifflinkplural' => 'last {{PLURAL:$1|change|999=changes}}', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 4d84a950f8..700d7c5cf5 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -820,19 +820,27 @@ Appears in subtitle. Parameters: Parameters: * $1 - a link back to the current page: {{FULLURL:{{FULLPAGENAME}}}}', -'youhavenewmessages' => 'The yellow message appearing when someone edited your user talk page. +'youhavenewmessages' => "The yellow message appearing when someone edited your user talk page. -The format is: "{{int:youhavenewmessages| [[MediaWiki:Newmessageslinkplural/{{SUBPAGENAME}}|{{int:newmessageslinkplural}}]] |[[MediaWiki:Newmessagesdifflinkplural/{{SUBPAGENAME}}|{{int:newmessagesdifflinkplural}}]]}}" +The format is: {{int:youhavenewmessages| [[MediaWiki:Newmessageslinkplural/{{SUBPAGENAME}}|{{int:newmessageslinkplural}}]] |[[MediaWiki:Newmessagesdifflinkplural/{{SUBPAGENAME}}|{{int:newmessagesdifflinkplural}}]]}} Parameters: * $1 - a link points to new messages. Its text is {{msg-mw|Newmessageslinkplural}} * $2 - a link points to new messages diff. Its text is {{msg-mw|Newmessagesdifflinkplural}} +* $3 - 1 or 999: +** 1 if there was '''one''' new edit since the last time the user has seen their talk page +** 999 - if there was '''more than one''' new edit since the last time the user has seen their talk page See also: -* {{msg-mw|Youhavenewmessagesmanyusers}}', -'youhavenewmessagesfromusers' => 'New talk indicator message: the message appearing when someone edited your user talk page. Parameters: +* {{msg-mw|Youhavenewmessagesmanyusers}}", +'youhavenewmessagesfromusers' => "New talk indicator message: the message appearing when someone edited your user talk page. + +Parameters: * $1 - defined as {{msg-mw|newmessageslinkplural}} * $2 - defined as {{msg-mw|newmessagesdifflinkplural}} -* $3 - the number of authors who have edited the talk page since the owning user last viewed it', +* $3 - the number of authors who have edited the talk page since the owning user last viewed it +* $4 - 1 or 999: +** 1 if there was '''one''' new edit since the last time the user has seen their talk page +** 999 - if there was '''more than one''' new edit since the last time the user has seen their talk page", 'youhavenewmessagesmanyusers' => 'New talk indicator message: the message appearing when someone edited your user talk page. Used when more than 10 users edited the user talk page since the owning user last viewed it, similar to {{msg-mw|youhavenewmessages}}. -- 2.20.1